package com.wuseguang.springcloud.controller;


import com.wuseguang.springcloud.Filter.RequestParameterWrapper;
import com.wuseguang.springcloud.service.DepartmentService;
import com.wuseguang.springcloud.util.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 学校部门 前端控制器
 * </p>
 *
 * @author 
 * @since 2020-01-04
 */
@RestController
@RequestMapping("/department")
public class DepartmentController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private DepartmentService departmentServiceImpl;

    @RequestMapping("/findSchoolDepartment")
    public Result findSchoolDepartment(RequestParameterWrapper request,
                                       @RequestParam(value = "type",required = false,defaultValue = "1") Integer type){

        logger.info("查询学校的部门信息 DepartmentController -> findSchoolDepartment type ={}",type);
        String schoolId = request.getParam("schoolId");
        logger.info("学校id = {}",schoolId);
        return  departmentServiceImpl.findSchoolDepartment(schoolId,type);
    }

}

